package com.zygh.policeasset.mapper;

import com.zygh.policeasset.pojo.Task;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/mapper/TaskMapper.class */
public interface TaskMapper {
    @Insert({"insert into task (bean_name,metho_dname,task_time,comment,rate,cycle,notice_affiche_id) values (#{beanName},#{methoDname},#{taskTime},#{comment},#{rate},#{cycle},#{noticeAfficheId})"})
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    Integer add(Task task);

    @Select({"select t.* from task t left join notice_affiche na on t.notice_affiche_id= na.id where na.send = 0 "})
    @Results({@Result(property = "taskTime", column = "task_time"), @Result(property = "beanName", column = "bean_name"), @Result(property = "methoDname", column = "metho_dname")})
    List<Task> queryTask();

    @Select({"select * from task where notice_affiche_id = #{noticeAfficheId} "})
    @Results({@Result(property = "taskTime", column = "task_time"), @Result(property = "beanName", column = "bean_name"), @Result(property = "methoDname", column = "metho_dname"), @Result(property = "noticeAfficheId", column = "notice_affiche_id")})
    Task queryTaskByNoticeAfficheId(Integer num);

    @Delete({"delete  from task where id = #{id} "})
    Integer delete(Integer num);

    @Update({"<script> update task<set><if test='state != null' >state=#{state},</if><if test='taskTime != null ' >task_time=#{taskTime},</if></set>WHERE id = #{id} </script>"})
    int updateTask(@Param("state") Integer num, @Param("id") Integer num2, @Param("taskTime") String str);
}